<?php

namespace app\admin\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;
use \Exception;
use app\api\controller\Crontab;
class GetCrontabMessage extends Command
{
    protected function configure()
    {
        $this->setName('crontab_message')->setDescription('定时任务奖扣任务消息');
    }

    protected function execute(Input $input, Output $output)
    {
        $output->writeln("开始crontab日任务," . date("Y-m-d H:i:s"));

        try {
            $crontab = new Crontab();
            //奖扣任务消息 日任务 凌晨1点执行
//            $crontab ->prize_buckle_task();
//            $crontab ->update_user_integral_b();
            $crontab ->update_integral_data();
        } catch (Exception $e) {
            $output->writeln("中断," . date("Y-m-d H:i:s") . ",原因：：" . $e->getMessage());
        }
        $output->writeln("完成," . date("Y-m-d H:i:s"));
    }
}
